/*
 * @Author: Mcfly
 * @Date: 2021-07-18 10:36:31
 * @LastEditTime: 2021-07-26 17:16:12
 * @LastEditors: Mcfly
 * @Description: NLinkTOF模块驱动
 * @FilePath: \FTTfly\BSPdriver\NLinkTOF.h
 * 本人github:https://github.com/McflyWZX
 */

#ifndef __NLINK_TOF_H__
#define __NLINK_TOF_H__

#include "stdbool.h"
#include "stdint.h"

typedef struct
{
    uint8_t id;
    float length;
    uint8_t signalStrength;
    uint8_t status;
} NLinkTOF;

typedef struct
{
    uint8_t header;
    uint8_t funMark;
    uint8_t reserved1;
    uint8_t id;
    uint8_t sysTime1;
    uint8_t sysTime2;
    uint8_t sysTime3;
    uint8_t sysTime4;
    uint8_t distance1;
    uint8_t distance2;
    uint8_t distance3;
    uint8_t status;
    uint8_t signalStrength1;
    uint8_t signalStrength2;
    uint8_t reserved2;
    uint8_t checkSum;
} NlinkTOF_RawData;

NLinkTOF *NLinkTOF_Init(uint8_t id);
void NLinkTOF_Req(NLinkTOF *tof);

#endif
